//Client.java
package memento.whitebox;

import java.util.Date;

/**
 *@author:youtubezou
 *@version:2012-8-16
 */
public class Client
{
	private static final int SECOND = 1000;
	public static void main(String[] args) throws InterruptedException
	{
		Subject obj = new Subject();
		System.out.println(obj);
		System.out.println("Current State = " + obj);
		
		obj.changeState("state at time : " + new Date() );
		System.out.println("Current State = " + obj);
		obj.saveState();
		
		Thread.sleep(4*SECOND);
		obj.changeState("state at time : " + new Date());
		System.out.println("Current State = " + obj);
		
		System.out.println("restoring......");
		Thread.sleep(3 * SECOND);
		System.out.println("Current State = " + obj.restoreState());

	}

}
